﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;

namespace FileStrider
{
    /// <summary>
    /// Interaction logic for DriveTooltip.xaml
    /// </summary>
    public partial class DriveTooltip : UserControl
    {
        public DriveTooltip(string drive)
        {
            InitializeComponent();

            DriveInfo driveInfo = new DriveInfo(drive);

            ImageDriveIcon.Source = Helper.GetDriveIcon(drive);
            LabelDiskName.Content = driveInfo.Name;

            if (driveInfo.IsReady)
            {
                LabelVolumeLabel.Content = driveInfo.VolumeLabel;
                LabelTotalSize.Content = "Total size: " + (driveInfo.TotalSize/1024/1024).ToString("N0") + " Mb";
                LabelFreeSpace.Content = "Free space: " + (driveInfo.TotalFreeSpace / 1024 / 1024).ToString("N0") + " Mb";
            }
        }
    }
}
